<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>统计信息 - 知识库</title>
    <style>
        body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: #f5f5f5; color: #1a1a1a; }
        .container { max-width: 900px; margin: 40px auto; background: #fff; border-radius: 12px; box-shadow: 0 4px 20px #0001; padding: 32px; }
        .section-title { font-size: 20px; font-weight: 600; margin: 32px 0 16px 0; }
        .stats-table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fafafa; border-radius: 8px; box-shadow: 0 2px 8px #0001; margin-bottom: 32px; }
        .stats-table th, .stats-table td { padding: 12px 8px; border-bottom: 1px solid #eee; }
        .stats-table th { background: #f5f5f5; font-weight: 600; }
        .stats-table tr:last-child td { border-bottom: none; }
        .empty-tip { color: #888; text-align: center; padding: 32px 0; }
    </style>
</head>
<body>
<div class="container">
    <div class="section-title">我的统计</div>
    <table class="stats-table">
        <tr><th>文档总数</th><td>${userStats.documentCount}</td></tr>
        <tr><th>收藏文档数</th><td>${userStats.favoriteCount}</td></tr>
        <tr><th>评论数</th><td>${userStats.commentCount}</td></tr>
    </table>

    <div class="section-title">我参与的空间统计</div>
    <c:choose>
        <c:when test="${not empty spaceStatsList}">
            <table class="stats-table">
                <thead>
                    <tr><th>空间名称</th><th>成员数</th><th>文档数</th></tr>
                </thead>
                <tbody>
                    <c:forEach var="space" items="${spaceStatsList}">
                        <tr>
                            <td>${space.name}</td>
                            <td>${space.memberCount}</td>
                            <td>${space.documentCount}</td>
                        </tr>
                    </c:forEach>
                </tbody>
            </table>
        </c:when>
        <c:otherwise>
            <div class="empty-tip">暂无空间统计信息。</div>
        </c:otherwise>
    </c:choose>
</div>
</body>
</html> 